package design.simdi.code.final_paper.site.panels.proiecte.bibliografie;

import org.apache.wicket.model.LoadableDetachableModel;

import design.simdi.code.final_paper.core.daos.BibliographyDao;
import design.simdi.code.final_paper.core.entities.Bibliography;

/**
 * 
 * @author Marius Dumitriu - (Jun 21, 2010 - 3:44:17 PM)
 * 
 */
public class DetachableBibliographyModel extends LoadableDetachableModel<Bibliography> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final long id;
	private final BibliographyDao bibliographyDao;

	public DetachableBibliographyModel(Bibliography object, BibliographyDao bibliographyDao) {
		super(object);
		this.id = object.getId();
		this.bibliographyDao = bibliographyDao;
	}

	@Override
	protected Bibliography load() {
		return bibliographyDao.get(id);
	}

}
